html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Nunito", sans-serif;
  min-height: 100vh;
}

/* Grid */
.App {
  padding: 0 2em;
  margin: 2em auto;
  max-width: 120em;
}

@media screen and (min-width: 48em) {
  .App {
    display: grid;
    grid-template-columns: 0.9fr 1.25fr;
    grid-template-rows: auto 1fr;
    grid-gap: 0 5em;
  }
}

/* Editor */
.app-editor {
  background: #151515;
  box-shadow: rgba(0, 0, 0, 0.55) 0px 20px 68px;
  border-radius: 5px;
  padding: 1.2em;
  max-width: 100%;
  overflow: auto;
  position: sticky;
  top: 30px;
}

.token.comment {
  color: hsl(0, 0%, 38%) !important;
}

.prism-code {
  background: none !important;
  padding: 0 !important;
  overflow: hidden auto;
  max-width: 40vw;
}

.app-editor__tab {
  padding-bottom: 1em;
  display: block;
}

.app-editor__tab span,
.app-editor__tab:before,
.app-editor__tab:after {
  content: "";
  height: 12px;
  width: 12px;
  border-radius: 100%;
  margin-right: 8px;
  display: inline-block;
}

.app-editor__tab:before {
  background-color: #f85955;
  border: 1px solid #d74246;
}

.app-editor__tab span {
  background-color: #fbbe3f;
  border: 1px solid #d7a32d;
}

.app-editor__tab:after {
  background-color: #45cc4b;
  border: 1px solid #40ad36;
}

.copy-to-clipboard {
  float: right;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-transform: uppercase;
  font-size: 0.6em;
  color: #999;
  letter-spacing: 2px;
  margin-top: -35px;
}

.app-editor:hover .copy-to-clipboard {
  opacity: 1;
}

.copy-to-clipboard:active {
  transform: translateY(1px);
}

.react-live-error {
  padding: 0.5em;
  border-radius: 0.25rem;
  background-color: rgba(206, 17, 38, 0.05);
  color: #f85955;
}

/* Canvas */
.app-canvas {
  position: relative;
  min-height: 8em;
  transition: all 0.3s ease;
  overflow: hidden;
}

.app-canvas:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: -webkit-repeating-radial-gradient(
    top center,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 100%
  );
  background-size: 20px 20px;
  transition: all 0.3s ease;
  opacity: 0;
}

.app-canvas:hover:before {
  opacity: 1;
}

.app-canvas__guideline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 100%;
}

.app-canvas:hover .app-canvas__guideline {
  opacity: 1;
}

.app-canvas__sketch {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  border: 1px solid transparent;
  transition: border 0.3s ease;
  border-radius: 3px;
}

.app-canvas:hover .app-canvas__sketch {
  border: 1px solid #f5f5f5;
}

.react-live-preview {
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.app-canvas:hover .react-live-preview {
  opacity: 0.9;
}

.app-canvas__draw .upper-canvas {
  cursor: crosshair !important;
}

/* Handlers */
.app-handlers {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

.app-handlers > * {
  margin-right: 1em;
}

.app-handlers button {
  background: none;
  border: 0;
  outline: 0;
  cursor: pointer;
}

.app-handler__clone,
.app-handlers__tool {
  vertical-align: middle;
  width: 3.4em;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.app-handlers__tool img {
  width: 100%;
  height: auto;
}

.app-handler__clone img {
  width: 100%;
  height: auto;
}

.app-handler__clone:hover,
.app-handlers__tool:hover,
.app-handlers__tool.app-handlers__active {
  opacity: 1;
}

.app-handlers .app-handler__trash {
  float: right;
  width: 2.8em;
  opacity: 1;
  margin: 1px;
}

.app-handlers .app-handler__clone {
  float: right;
}

.app-handlers .app-handlers__div {
  border-left: 1px solid #f0f0f0;
  line-height: 2.3em;
  font-size: 0.8em;
  font-weight: 300;
  color: #a5a5a5;
  display: inline-block;
  height: 2.2em;
  padding-left: 1em;
  vertical-align: middle;
}

.app-handlers .app-handlers__preset {
  line-height: 1.3;
  color: #a5a5a5;
  font-weight: 600;
  font-size: 0.8em;
  display: inline-block;
  vertical-align: middle;
  padding: 0 0.5em;
  transition: color 0.3s ease;
}

.app-handlers .app-handlers__preset:hover {
  color: #000;
}

/* Config */
.app-config {
  margin-top: 2em;
  padding-top: 2em;
  border-top: 1px solid #f0f0f0;
  width: 100%;
}

.app-config > div {
  width: 85%;
}

.app-config p {
  padding: 0.5em 0;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  width: calc(100% / 4);
  box-sizing: border-box;
}

.app-config label {
  margin-right: 0.4em;
  display: block;
  font-weight: 300;
  color: #a5a5a5;
  min-width: 3em;
  font-size: 0.9em;
  vertical-align: middle;
}

.app-config button {
  background: none;
  border: 0;
  padding: 0;
  outline: 0;
  color: #a5a5a5;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 300;
  transition: background 0.3s ease;
  position: relative;
  top: 7px;
}

.app-config button:hover {
  text-decoration: underline;
}

.app-config input {
  border: 0;
  font-size: 1em;
  height: 2em;
  font-weight: 300;
  color: #000;
  width: 4em;
  display: inline-block;
  outline: 0;
  margin: 0;
  padding: 0;
}

.app-config input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 2px;
  position: relative;
  top: 4px;
}

.app-config input[type="checkbox"] {
  height: auto;
  width: auto;
  margin-right: 1em;
  margin-bottom: 1em;
}

.app-config .properties {
  margin-bottom: 0;
  color: #000;
}

.app-config .toggle {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  cursor: pointer;
}

.app-config .toggle-input {
  display: none;
}

.app-config .toggle-check {
  margin-right: 0.75em;
  position: relative;
  margin-top: 0.2em;
}

.app-config .toggle-check:before {
  content: "";
  display: block;
  position: relative;
  width: 2.2rem;
  height: 1.45rem;
  border-radius: 1rem;
  background: #f8f8f8;
  cursor: pointer;
  background: #eee;
  transition: all 0.3s ease;
}

.app-config .toggle-check:after {
  content: "";
  display: block;
  background: #fff;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.02);
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 1.2rem;
  position: absolute;
  left: 0.15rem;
  top: 0.15rem;
  transition: all 0.3s ease;
}

.app-config .toggle-check.checked:before {
  box-shadow: inset 0 0 0 18px #1cd01c;
}

.app-config .toggle-check.checked:after {
  left: calc(100% - 1.15rem - 0.15rem);
}

.app-config .app-config__guideline {
  width: 100%;
}

.app-config .app-config__guideline input {
  width: 100%;
  padding-left: 26px;
  border-bottom: 1px solid #f0f0f0;
  background: url(../assets/grid.svg) -5px 0px no-repeat;
  background-size: auto 30px;
}

.tippy-tooltip {
  position: relative;
  color: #fff;
  border-radius: 4px;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  text-align: center;
  will-change: transform;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #333;
  pointer-events: none;
}

.handle-framework {
  background: none;
  border: 0;
  outline: 0;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  font-size: 0.9em;
  padding-right: 1em;
  margin-right: 0.8em;
  margin-bottom: 1em;
  opacity: 0.5;
  transition: all 0.3s ease;
  color: #686768;
  text-decoration: none;
}

.handle-framework:first-child {
  border-right: 1px solid #eee;
}

.handle-framework.current {
  opacity: 1;
}

.handle-framework img {
  height: 1.3em;
  margin-right: 0.8em;
}
